package com.pxx.service.mapper;

import com.pxx.item.pojo.Brand;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {

    @Insert("insert into tb_category_brand(category_id, brand_id) VALUE (#{cid},#{bid})")
    int insertCategoryAndBrand(Long cid, Long bid);

    @Select("select t2.* from tb_category_brand t1 inner join tb_brand t2 on t1.brand_id = t2.id where  t1.category_id = #{cid}")
    List<Brand> queryBrandByCid(Long cid);
}
